home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / sharewar / FFE / MISC.SWG / 0007_SWG (SWAG).pas < prev    next >
Pascal/Delphi Source File  |  1996-09-04  |  2KB  |  43 lines

  1. --------?-SWG-------------------------------
  2.  
  3. Since the inception of SWAG over two years ago, it has become a standard
  4. library  used by PASCAL programmers all  over the world. I often receive
  5. mail from users wanting to create their own SWAG packets. Therefore, I'm
  6. releasing  SWAGADD  which  is the program that  I  use to create the new
  7. snipets every 90 days.
  8.  
  9. SWAG  (.SWG) files are actually highly compressed LZH archive files with
  10. extensions  to  the  header  and  a  double  splayed  sliding dictionary
  11. compressed buffer.
  12.  
  13. The SWAG file headers have this structure :
  14.  
  15. TYPE
  16.   SwagHeader =
  17.     RECORD
  18.       HeadSize : BYTE;                  {size of header}
  19.       HeadChk  : BYTE;                  {checksum for header}
  20.       HeadID   : ARRAY [1..5] OF CHAR;  {compression type tag}
  21.       NewSize  : LONGINT;               {compressed size}
  22.       OrigSize : LONGINT;               {original size}
  23.       Time     : WORD;                  {packed time}
  24.       Date     : WORD;                  {packed date}
  25.       Attr     : WORD;                  {file attributes and flags}
  26.       BufCRC   : LONGINT;               {32-CRC of the Buffer }
  27.       Swag     : STRING[12];            {stored SWAG filename}
  28.       Subject  : STRING[40];            {snipet subject}
  29.       Contrib  : STRING[35];            {contributor}
  30.       Keys     : STRING[70];            {search keys, comma deliminated}
  31.       FName    : PathStr;               {filename (variable length)}
  32.       CRC      : WORD;                  {16-bit CRC (immediately follows FName)}
  33.     END;
  34.  
  35. Following  each header is a highly compressed buffer optimized for space
  36. and  extraction  speed. This makes the  extraction or viewing of snipets
  37. VERY  VERY FAST. Unfortunately, you WILL NOT be able to use standard LZH
  38. code  to  decompress this buffer, however,  you'll find code in the SWAG
  39. distribution  to  read  the  headers.  Maybe  someday,  I'll release the
  40. decompression  code to the public domain, but for now, it's copyrighted,
  41. and unavailable.
  42.  
  43.